package crawler;


public class CrawlItem implements Comparable<CrawlItem> {
	private String URL;
	private int randomID;
	public boolean crawled = false;
	public int index = 0;// index in the original crawl list
	
	public CrawlItem(String URL, int id){
		this.URL = URL;
		randomID = id;
	}
	public String getURL() {
		return URL;
	}

	public void setURL(String uRL) {
		URL = uRL;
	}

	public int getRandomID() {
		return randomID;
	}

	public void setRandomID(int randomID) {
		this.randomID = randomID;
	}

	public boolean isCrawled() {
		return crawled;
	}

	public void setCrawled(boolean crawled) {
		this.crawled = crawled;
	}

	@Override
	public int compareTo(CrawlItem o) {
		if (this.randomID < o.randomID) {
			return 1;
		} else if (this.randomID > o.randomID) {
			return -1;
		} else {
			return 0;
		}
	}

}